package wangchao.validate;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import wangchao.validate.annotation.WangcMethodValidate;
import wangchao.validate.annotation.WangcParamterValidate;
import wangchao.validate.annotation.WangcTypeValidate;
import wangchao.validate.filter.DataValidate;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 模拟登录验证
 * Created by ashin on 2018/11/1.
 */
public class LoginValidate {

    protected static final Logger logger = LoggerFactory.getLogger(DataValidate.class);

    @WangcMethodValidate(names = {
            @WangcParamterValidate(name = "userName", type = {
                    @WangcTypeValidate(
                            validate = ValidateType.REGEX
                    )
            })
    })
    public void doLogin(@WangcTypeValidate(validate = ValidateType.MAX_LENGTH,specify = 10,fieldType = FieldTypeEnum.NUMBER) Map map) throws Exception {
        logger.info("执行登录方法");
    }
}
